import json
from typing import Any, Optional

# status service
from app.api.service import sche_service
from app.common.response.response_schema import response_base
from app.core.conf import ST
from app.schemas.agv import RQAGVStatus
from app.schemas.job import ReqCreateJob
from app.schemas.sche import ReqJob
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel
from sqlalchemy.orm import Session

# 创建status router路由
status_router = APIRouter()


@status_router.post("/")
async def get_status(params: RQAGVStatus):
    # params.m_ip
    with open(ST.AGV_STATUS_PATH, "r", encoding="utf-8") as f:
        content = json.load(f)
    return response_base.response_200(msg="查询成功", data=content[params.m_ip])
